package com.goldenKey.common.pojo.enumeration;

/**
 * 图书借阅状态
 */
public enum BorrowStatusEnum {

    NORMAL(0, "正常归还"),
    BORROWING(1, "借阅中"),
    DUE_SOON(2, "即将到期"),
    OVERDUE(3, "已逾期"),
    OVERDUE_RETURN(4, "逾期归还"),
    DAMAGE_RETURN(5, "损坏归还"),
    OVERDUE_DAMAGE_RETURN(6, "逾期孙环归还"),
    RETURN_TO_TEST(7, "归还检测中");


    private Integer status;
    private String desc;

    BorrowStatusEnum(int status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public static BorrowStatusEnum getByStatus(Integer status) {
        for(BorrowStatusEnum item : BorrowStatusEnum.values()) {
            if(item.getStatus().equals(status)) {
                return item;
            }
        }
        return null;
    }

    public Integer getStatus() {
        return this.status;
    }
    public String getDesc() {
        return this.desc;
    }
}
